package com.example.container.wait;

/**
 * Created by ZMJ on 2019/12/29.
 */
public class WaitRunnable implements Runnable {
    private Object object = new Object();

    @Override
    public void run() {
        synchronized (object) {
            while (true) {
                System.out.println(Thread.currentThread().getName() + "将被等待阻塞");
                try {
                    object.wait(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
